package com.mzj.saas.mservice.sys.controller;

import com.mzj.saas.commons.ResultBean;
import com.mzj.saas.mservice.sys.service.WithdrawUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/*
 *提现人设置
 */
@Controller
@RequestMapping("/withdraw")
public class WithdrawUserController {
    private static final Logger LOG = LoggerFactory.getLogger(WithdrawUserController.class);
    @Autowired
    private WithdrawUserService withdrawUserService;

    /*
     *新增提现人
     */
    @PostMapping("peopleSet")
    @ResponseBody
    public ResultBean<Object> peopleSet(@RequestHeader String accessToken, @RequestParam(name = "userId", required = false) String userId) {
        return withdrawUserService.peopleSet(accessToken, userId);
    }

    /*
     *删除提现人
     */
    @PostMapping("peopleDelete")
    @ResponseBody
    public ResultBean<Object> peopleDelete(@RequestHeader String accessToken, @RequestParam(name = "userId", required = false) String userId) {
        return withdrawUserService.peopleDelete(accessToken, userId);
    }

    /*
     *提现人列表显示
     */
    @PostMapping("peopleList")
    @ResponseBody
    public ResultBean<Object> peopleList(@RequestHeader String accessToken, @RequestParam(defaultValue = "0") Integer pageNumber,
                                         @RequestParam(defaultValue = "10") Integer pageSize) {
        return withdrawUserService.peopleList(accessToken, pageNumber, pageSize);
    }
}
